﻿namespace Longbow.Web
{
    /// <summary>
    ///
    /// </summary>
    internal class JuheIPLocator : DefaultIPLocator
    {
        /// <summary>
        ///
        /// </summary>
        public string ResultCode { get; set; }

        /// <summary>
        ///
        /// </summary>
        public string Reason { get; set; }

        /// <summary>
        ///
        /// </summary>
        public JuheIPLocatorResult Result { get; set; }

        /// <summary>
        ///
        /// </summary>
        /// <value></value>
        public int Error_Code { get; set; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        public override string Locate(IPLocatorOption option) => Locate<JuheIPLocator>(option);

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Error_Code != 0 ? "XX XX" : Result.ToString();
        }
    }
}
